package com.jyserver.common.AutoCode.jybaits.element.pc;

import com.jyserver.common.AutoCode.jybaits.element.pc.From.Creat;
import com.jyserver.common.AutoCode.jybaits.element.pc.From.View;
import com.jyserver.common.AutoCode.jybaits.element.pc.Tables.table;

public class FormTableView {

    public String test(Object Tbalevue, Object Viewvue, Object Creatvue, String createAPI, String handleViewAPI, String handleDeleteAPI,String postapi, String updateApi) {
        table t = new table(Tbalevue, createAPI, handleViewAPI, handleDeleteAPI, updateApi,postapi);
        View v = new View(Viewvue);
        Creat c = new Creat(Creatvue);
        t.adddatas(v.getFormsString());
        t.adddatas(c.getFormsString());
        t.adddatas(c.getFormsString().replace("Dataform", "Viewform"));
        t.adddatas(c.getStringRules());
        t.addimport(c.getimport());
        t.addcomponents(c.getcomponents());
        t.setHeader(" <!--获取医生出版图书_返回图书信息说明-->\n<template>\n" +
                "  <div>\n" +
                "\n" +
                "    <el-row style=\"margin: 15px; margin-bottom: 0;\">\n" +
                "\n" +
                "\n" +
                "      <el-button type=\"primary\" style=\"float: right; margin: 5px;\" icon=\"el-icon-circle-plus-outline\"\n" +
                "                 @click=\"createRecord()\">创建模块\n" +
                "      </el-button>\n" +
                "    </el-row>");
        v.setHeader("<el-dialog\n" +
                "      :title=\"dialog.title\"\n" +
                "      :visible.sync=\"dialog.view\"\n" +
                "      center>\n");
        v.setEndString("<span slot=\"footer\" class=\"dialog-footer\">\n" +
                "    <el-button @click=\"dialog.view = false\">关闭</el-button>\n" +
                "  </span>\n" +
                "    </el-dialog>\n");
        c.setHeader("<el-dialog\n" +
                "      :title=\"dialog.title\"\n" +
                "      :visible.sync=\"dialog.view\"\n" +
                "      center>\n");
        c.setEndString("<span slot=\"footer\" class=\"dialog-footer\">\n" +
                "         <el-button type=\"primary\" @click=\"submitForm('Dataform')\">确定</el-button>\n" +
                "          <el-button @click=\"resetForm('Dataform')\">重置</el-button>\n" +
                "  </span>\n" +
                "    </el-dialog>\n");
        t.setEndString(c.getform() + v.getform() + "</div>\n" +
                "</template>");
        return t.creatAll(c.getValidatorString());
    }

    public String test(Object Tbalevue, Object Viewvue, Object Creatvue, String createAPI, String handleViewAPI, String handleDeleteAPI, String updateApi, String postapi, String note) {
        table t = new table(Tbalevue, createAPI, handleViewAPI, handleDeleteAPI, updateApi,postapi);
        View v = new View(Viewvue);
        Creat c = new Creat(Creatvue);
        t.adddatas(v.getFormsString());
        t.adddatas(c.getFormsString());
        t.adddatas(c.getFormsString().replace("Dataform", "DataformTest"));
        t.adddatas(c.getStringRules());
        t.addimport(c.getimport());
        t.addcomponents(c.getcomponents());
        t.setHeader(" <!--" + note + "-->\n<template>\n" +
                "  <div>\n" +
                "\n" +
                "    <el-row style=\"margin: 15px; margin-bottom: 0;\">\n" +
                "\n" +
                "\n" +
                "      <el-button type=\"primary\" style=\"float: right; margin: 5px;\" icon=\"el-icon-circle-plus-outline\"\n" +
                "                 @click=\"createRecord()\">创建模块\n" +
                "      </el-button>\n" +
                "    </el-row><el-table\n" +
                "      :data=\"tableData\"\n" +
                "      tooltip-effect=\"dark\"\n" +
                "      v-loading=\"loadingShow\"\n" +
                "      element-loading-text=\"拼命加载中\"\n" +
                "      element-loading-spinner=\"el-icon-loading\"\n" +
                "      element-loading-background=\"rgba(0, 0, 0, 0.8)\"\n" +
                "      style=\"width: 100%\"\n" +
                "      size=\"mini\"\n" +
                "    >");
        v.setHeader("<el-dialog\n" +
                "      :title=\"dialog.title\"\n" +
                "      :visible.sync=\"dialog.view\"\n" +
                "      center>\n");
        v.setEndString("<span slot=\"footer\" class=\"dialog-footer\">\n" +
                "    <el-button @click=\"dialog.view = false\">关闭</el-button>\n" +
                "  </span>\n" +
                "    </el-dialog>\n");
        c.setHeader("<el-dialog\n" +
                "      :title=\"dialog.title\"\n" +
                "      :visible.sync=\"dialog.edit\"\n" +
                "      center>\n");
        c.setEndString("<span slot=\"footer\" class=\"dialog-footer\">\n" +
                "         <el-button type=\"primary\" @click=\"submitForm('Dataform')\">确定</el-button>\n" +
                "          <el-button @click=\"resetForm('Dataform')\">重置</el-button>\n" +
                "  </span>\n" +
                "    </el-dialog>\n");
        t.setEndString("</el-table>"+c.getform() + v.getform() + "</div>\n" +
                "</template>");
        return t.creatAll(c.getValidatorString());
    }
}
